//
//  DYUpdateCodeView.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/21.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYUpdateCodeView.h"

@implementation DYUpdateCodeView

-(instancetype)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    return self;
}
-(void)initView
{
    self.backgroundColor=WhiteColor;
    
    self.titleLabel=({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_content] alignment:0];
        label.text=@"验证码";
        label;
    });
    
    self.textField = ({
        UITextField *text=[[UITextField alloc]init];
        text.font=kFont(14);
        text.placeholder=@"请输入验证码";
        [text setValue:[UIColor xhq_assist] forKeyPath:@"_placeholderLabel.textColor"];
        text.autocorrectionType = UITextAutocorrectionTypeNo;
        [text setNumbersKeyboard];
        text;
    });
    
    self.codeButton=({
        UIButton *button=[Utils createBtnWithType:UIButtonTypeCustom backgroundColor:WhiteColor action:@selector(codeButtonClick) target:self title:@"获取验证码" image:nil font:15 textColor:[UIColor xhq_base]];
        button.contentHorizontalAlignment=UIControlContentHorizontalAlignmentRight;
        button;
    });
    
    self.line =({
        UILabel *line=[UILabel xhq_lineLabel];
        line;
    });
    
    [self addSubview:self.titleLabel];
    [self addSubview:self.textField];
    [self addSubview:self.codeButton];
    [self addSubview:self.line];
    
    [self.titleLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(0);
        make.top.equalTo(BILIHEIGHT(10));
    }];
    
    [self.textField makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self);
        make.height.equalTo(BILIHEIGHT(30));
        make.left.equalTo(0);
        make.right.equalTo(BILIWIDTH(-130));
    }];
    
    [self.codeButton makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(0);
        make.top.equalTo(BILIHEIGHT(15));
        make.height.equalTo(BILIHEIGHT(40));
        make.width.equalTo(BILIWIDTH(80));
    }];
    
    
    [self.line makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(0);
        make.bottom.equalTo(0);
        make.height.equalTo(BILIWIDTH(0.7));
    }];
}
-(void)codeButtonClick
{
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
